#include <iostream>
using namespace std;

void reverse(char* str) {
	int length = 0;
	int i = 0;
	char temp;
	while(str[length] != '\0') length++;
	while(i <= length--) {
		temp = str[i];
		str[i++] = str[length];
		str[length] = temp;
	}
}

int main() {
    char str[] = "lorem ipsum";
    cout << str << endl;
    reverse(str);
    cout << str << endl;
    return 0;
}
